package org.example.tx;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;

@Component
@Slf4j
public class TxRunner implements CommandLineRunner {

    @Autowired
    private TxWorker service;

    @Override
    public void run(String... args) throws Exception {
        try {
            service.run();
            log.info("finish.");
        } catch (Exception error) {
            log.error("Application error: {}", error.getMessage());
        }
    }
}
